<%@ page import="com.hc.commodity.pojo.Dept" %>
<%@ page import="com.hc.commodity.dao.impl.DeptDaoImpl" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/4/9
  Time: 12:29
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加部门表</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
</head>
<body>

    <%
        request.setCharacterEncoding("utf-8");
        String deptid = request.getParameter("deptid");
        if (deptid != null){
            Dept dept = new Dept();
            dept.setDeptno(Integer.parseInt(deptid));
            dept.setDname(request.getParameter("dname"));
            dept.setLoc(request.getParameter("location"));
            new DeptDaoImpl().addDept(dept);
            request.getRequestDispatcher("deplManage.jsp").forward(request,response);
        }
    %>
    <div class="container">
        <ul class="breadcrumb">
            <li><a href="#">员工管理系统</a></li>
            <li><a href="deplManage.jsp" target="mainFrame">部门管理</a></li>
            <li><a href="#">新建部门</a></li>
        </ul>
        <form class="form-horizontal" action="deplInsert.jsp" method="post">
            <div class="form-group">
                <label for="deptid" class="col-md-2 control-label col-md-offset-2">部门号</label>
                <div class="col-md-3">
                    <input type="test" class="form-control" id="deptid" placeholder="请输入部门id" name="deptid">
                </div>
            </div>
            <div class="form-group">
                <label for="dname" class="col-md-2 control-label col-md-offset-2">部门名称</label>
                <div class="col-md-3">
                    <input type="test" class="form-control" id="dname" placeholder="请输入部门名称" name="dname">
                </div>
            </div>
            <div class="form-group">
                <label for="location" class="col-md-2 control-label col-md-offset-2">部门位置</label>
                <div class="col-md-3">
                    <input type="test" class="form-control" id="location" placeholder="请输入部门位置" name="location">
                </div>
            </div>
            <div class="form-group">
                <input type="submit" value="确定" class="col-md-offset-5 btn btn-primary">
            </div>

        </form>
    </div>
</body>
</html>
